package com.fdd.dao.impl;

import com.fdd.dao.BookDao;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component("BookDaoImpl")
@Scope("prototype")
public class BookDaoImpl implements BookDao {

    @Value("${jdbc.name}")
    String name;

    @Override
    public void save() {
        System.out.println("BookDaoImpl::save..." + name);
    }

    @PostConstruct
    public void init() {
        System.out.println("BookDaoImpl::init...");
    }

    @PreDestroy
    public void destroy() {
        System.out.println("BookDaoImpl::destroy...");
    }
}
